import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";
import qs from "qs";
import { ResDetail, ResPage, Takeout } from "@/api/interface";

export const getTakeoutOrderListAPI = (params: {}) => {
  return http.post<ResPage<Takeout.TakeoutOrderList>>(
    PORT1 + "/corecmsfoodordermaster/GetTakeOutOrderList",
    qs.stringify(params)
  );
};
export const getTakeoutListAPI = (params: {}) => {
  return http.post<ResPage<Takeout.TakeoutOrderList>>(PORT1 + "/meituan/GetMtFoodList", qs.stringify(params));
};
// export const takeoutBindingAPI = () => {
//   return http.post(PORT1 + "/meituan/OneKeySyncFoods");
// };
export const takeoutBindingAPI = (params: {}) => {
  return http.post(PORT1 + "/waimai/OneKeySyncFoods", params);
};

export const getOrderDetailAPI = (params: {}) => {
  return http.post<Takeout.TakeoutEdit>(PORT1 + "/corecmsfoodordermaster/GetOrderDetail", params);
};
// 绑定
// export const bindingGoodsAPI = (params: Takeout.TakeoutOrderList) => {
//   return http.post(PORT1 + "/meituan/BindMtFood", params);
// };
export const bindingGoodsAPI = (params: Takeout.TakeoutOrderList | undefined) => {
  return http.post(PORT1 + "/waimai/BindFood ", params);
};
// 绑定
// export const unbindingGoodsAPI = (params: {}) => {
//   return http.post(PORT1 + "/meituan/UnbindMtFood", params);
// };
export const unbindingGoodsAPI = (params: {}) => {
  return http.post(PORT1 + "/waimai/UnbindFood", params);
};

// 关联菜品 sourceType: 1，美团，2：饿了吗
export const relevancyWaimaiGoodsAPI = (params: {}) => {
  return http.post<Takeout.TakeoutRelevancy>(PORT1 + "/waimai/GetFoodList", params);
};
